package com.kedacom.freedomLabel.initdata.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.kedacom.freedomLabel.initdata.bean.Classes;
import com.kedacom.freedomLabel.initdata.bean.ProductDetail;
import com.kedacom.freedomLabel.model.db.dao.IDao;

import java.util.List;

/**
 * Created by yao on 2021/3/23.
 * Describe
 */
@Dao
public interface ProductDetailDao extends IDao<ProductDetail> {


    @Override
    @Query("SELECT COUNT(0) FROM ProductDetail")
    int count();


    @Override
    @Update
    void update(ProductDetail data);

    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long save(ProductDetail data);


    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long[] save(List<ProductDetail> data);


    @Override
    @Query("SELECT * FROM ProductDetail")
    List<ProductDetail> get();

    @Override
    @Query("SELECT * FROM ProductDetail WHERE gridId=:param")
    List<ProductDetail> get(String param);


    @Override
    @Query("SELECT * FROM ProductDetail WHERE gridId=:param1 and gridType=:param2")
    List<ProductDetail> get(String param1, String param2);

    @Override
    @Delete
    void delete(ProductDetail data);

    @Override
    @Query("DELETE FROM ProductDetail")
    void delete();

    @Override
    @Query("DELETE FROM ProductDetail WHERE gridId=:param ")
    void delete(String param);

//    @Query("SELECT * FROM ProductDetail")
//    List<ProductDetail> getAllProductDetail();
//
//
//    @Query("SELECT * FROM ProductDetail WHERE gridId=:gridId")
//    ProductDetail getAllProductDetailOne(String gridId);
//
//    @Insert
//    void insert(List<ProductDetail> userLists);
//
//    @Delete
//    void delete(List<ProductDetail> userLists);
}
